package info.ericbutler.microcosm.game;

import info.ericbutler.microcosm.entities.ui.ItemStack;

import java.util.HashMap;

import org.newdawn.slick.Animation;
import org.newdawn.slick.AppGameContainer;
import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Image;
import org.newdawn.slick.SlickException;
import org.newdawn.slick.UnicodeFont;
import org.newdawn.slick.state.StateBasedGame;

public class MicrocosmMain extends StateBasedGame {
	public static boolean						DEBUG_DRAW			= false;
	public static final int						SCREEN_WIDTH		= 1024;
	public static final int						SCREEN_HEIGHT		= 768;
	public static final boolean					FULLSCREEN			= false;
	public static UnicodeFont					GAME_FONT;
	public static int							LOADING_STATE		= 0;
	public static int							MAINMENU_STATE		= 1;
	public static int							SINGLE_PLAYER_STATE	= 2;
	public static int							MULTI_PLAYER_STATE	= 3;
	public static HashMap<String, Animation>	TILES				= new HashMap<>();
	public static HashMap<String, Image>		MENU_IMAGES			= new HashMap<>();
	public static ItemStack						MOUSE_ITEM;

	public MicrocosmMain(String name) {
		super( name );
	}

	public static void main(String[] args) throws SlickException {
		AppGameContainer myGame = new AppGameContainer( new MicrocosmMain( "Microcosm - Your own world" ) );
		myGame.setDisplayMode( SCREEN_WIDTH, SCREEN_HEIGHT, FULLSCREEN );
		myGame.setTargetFrameRate( 30 );
		myGame.setAlwaysRender( true );
		myGame.setVerbose( true );
		myGame.start();
	}

	@Override
	public void initStatesList(GameContainer container) throws SlickException {
		this.addState( new LoadingState( LOADING_STATE ) );
		this.addState( new MainMenuState( MAINMENU_STATE ) );
		this.addState( new SinglePlayerState( SINGLE_PLAYER_STATE ) );
		this.addState( new MultiPlayerState( MULTI_PLAYER_STATE ) );
	}
}
